PROJECT(NeonCore)

ADD_DEFINITIONS(-DNEON_BUILD_DLL)

SET(QT_USE_QTOPENGL TRUE)

FIND_PACKAGE(Qt4 REQUIRED)
FIND_PACKAGE(GLEW REQUIRED)
FIND_PACKAGE(Cg REQUIRED)

INCLUDE(${QT_USE_FILE})
INCLUDE_DIRECTORIES(${GLEW_INCLUDE_DIR})

SET(NEONENGINE_INCLUDE_DIR
    ../../includes
)

SET(NEONCORE_MOC_HDRS
    ${NEONENGINE_INCLUDE_DIR}/NeonCore/NeonWidget.hpp
)

QT4_WRAP_CPP(NEONCORE_MOC_SRCS
    ${NEONCORE_MOC_HDRS}
)

SET(NEONCORE_HDRS
    ${NEONENGINE_INCLUDE_DIR}/NeonCore/Colour.hpp
    ${NEONENGINE_INCLUDE_DIR}/NeonCore/Gl.hpp
    ${NEONENGINE_INCLUDE_DIR}/NeonCore/Global.hpp
    ${NEONENGINE_INCLUDE_DIR}/NeonCore/NeonWidget.hpp
    ${NEONENGINE_INCLUDE_DIR}/NeonCore/Timer.hpp
)

SET(NEONCORE_SRCS
    Colour.cpp
    Global.cpp
    NeonWidget.cpp
    Timer.cpp
    ${NEONCORE_MOC_SRCS}
)

SET(NEONCORE_LIBRARY
    neoncore
)

SET(NEONCORE_LINK_LIBRARIES
    ${NEONCORE_LIBRARY}
    ${QT_LIBRARIES}
    ${GLEW_LIBRARY}
    ${CG_LIBRARY}
)

ADD_LIBRARY(${NEONCORE_LIBRARY} SHARED ${NEONCORE_HDRS} ${NEONCORE_SRCS})

TARGET_LINK_LIBRARIES(${NEONCORE_LINK_LIBRARIES})

INSTALL(
    TARGETS
      ${NEONCORE_LIBRARY}
    DESTINATION
      ${NEONENGINE_INSTALL_DIR}/${APPLICATION_NAME}/lib
)